#!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
****************************************************
Project:python
Filename: serializers.py
Author:银河
Create: 2025/3/25 下午4:55 
Notes:
***************************************************
'''
from .models import NyCode,NyCodeType
from rest_framework import serializers
from rest_framework.serializers import ModelSerializer


class NyCodeTypeSerializers(ModelSerializer):
    class Meta:
        model = NyCodeType
        fields = "__all__"


class NyCodeSerializers(ModelSerializer):
    type = serializers.CharField(source='type.title')

    class Meta:
        model = NyCode
        fields = ['id','code','type','remark','utime','ctime']


class NyCodePostSerializers(ModelSerializer):
    class Meta:
        model = NyCode
        fields = "__all__"
